<template>
    <view style="background: #fff;width:100%;height:300hv; margin-bottom: 50rpx;">
        <view>
            <view style="display:flex; flex-direction: column; align-items:center; justify-content:center; padding:60rpx;">
                <icon v-if="isSuccess" type="success" size="50" color="#2d996c" />
                <icon v-else type="info" size="50" color="#2d996c" />
                <view style="margin-top:50rpx;color:#2d996c; font-size: 40rpx;">
                    {{isSuccess?'支付成功':"支付失败"}}
                </view>
            </view>
            <view style="display:flex; align-items:center; justify-content:space-between; padding: 40rpx 56rpx 40rpx 56rpx;">
                <view v-if="pageType<4" style="width:300rpx; padding:20rpx 50rpx; border:1rpx solid #989898; border-radius:10rpx; text-align:center; font-size: 34rpx; color: #989898;"
                    @tap='goIndex'>返回商店
                </view>
                <view v-if="pageType==4" style="width:300rpx; padding:20rpx 50rpx; border:1rpx solid #989898; border-radius:10rpx; text-align:center; font-size: 34rpx; color: #989898;"
                    @tap='goIndex'>返回首页
                </view>
                <view style="width:300rpx; padding:20rpx 50rpx; background:#2d996c; border-radius:10rpx; text-align:center; color:white;font-size: 34rpx;"
                    @tap='goDetail'>
                    查看订单</view>
            </view>
        </view>
        <!-- <view style="height:90rpx; display:flex; justify-content:center; align-items:center; padding:90rpx 30rpx 50rpx 30rpx;">
            <view style="background:#00654c;height:1rpx;width:200rpx;"></view>
            <view class='card-name' style="padding:0 50rpx;font-size: 34rpx;">更多商品</view>
            <view style="background-color:#00654c;height:1rpx;width:200rpx;"></view>
        </view> -->
        <!-- <CommodityList></CommodityList> -->
    </view>
</template>

<script>
// import CommodityList from '@/components/common/CommodityList.vue'
export default {
    data() {
        return {
            isSuccess: false,
            pageType: '', //1订单发起支付  2商品直接支付  3服务详情  4电影票支付
        }
    },
    components: {
        // CommodityList,
    },
    onLoad(query) {
        console.log(query, "result")
        if (query.type) {
            this.isSuccess = query.type == 'success';
            this.pageType = query.pageType
        }
    },
    methods: {
        goIndex() {
            uni.switchTab({
                url: "/pages/index/index"
            })
        },
        goDetail() {
            if (this.pageType == 3) {
                // 服务订单
                uni.navigateTo({
                    url: '/pagesA/my/serviceOrders'
                })
            } else if (this.pageType == 4) {
                // 电影票订单
                uni.navigateTo({
                    url: '/pagesB/movie/my-ticket'
                })
            } else {
                // 我的订单
                uni.navigateTo({
                    url: '/pagesA/my/myOrderList'
                })
            }
        }
    }
}
</script>


<style scoped>
.page {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
}
</style>